package com.innerchic.sponsor.poster;

import android.os.Handler;
import android.os.Looper;

/**
 * 上层发送类
 */
public class Poster {

    private final Handler postHandler;

    /**
     * 构造时如果looper为空,则使用当前调用进程的方法构造
     */
    public Poster(Looper looper) {
        postHandler = new Handler(looper == null ? Looper.myLooper() : looper);
    }

    public void post(Runnable runnable) {
        if (runnable == null) return;
        postHandler.post(runnable);
    }

}
